package cn.tedu.test.config;

import org.springframework.beans.factory.annotation.Autowired;

// @Configuration
// @EnableWebSecurity //SpringBoot 不需要他
// @EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig {// extends WebSecurityConfigurerAdapter {

//
//    @Autowired
//    UserDetailsServiceImpl userDetailsService;
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        //Web安全配置
//        http.authorizeRequests()
//                .mvcMatchers("/home/**").permitAll()
//                .mvcMatchers("/admin/**").hasRole("ADMIN")
//                .mvcMatchers("/actuator/**").permitAll()
//                .and().formLogin()
//                .and().authorizeRequests().anyRequest().authenticated();
//
//    }
//
//    @Override
//    public void configure(WebSecurity web) throws Exception {
//        web.ignoring().mvcMatchers("/images/**");
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        auth.userDetailsService(userDetailsService);
//    }
}
